package cz.proks.easyhelpdesk.gae.api.impl.db;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository;

import cz.proks.easyhelpdesk.api.FilterApi;
import cz.proks.easyhelpdesk.api.config.Configuration;
import cz.proks.easyhelpdesk.api.model.Filter;

@Repository(Configuration.DB.FILTER_API)
@Scope("prototype")
public class FilterApiImpl extends BaseHelpdeskApiImpl<Filter> implements FilterApi {
    private final Logger log = LoggerFactory.getLogger(getClass());
 
    @Override
    protected Class<Filter> getDomainClass() {
        return Filter.class;
    }

    @Override
    protected Filter getDboObject(Filter entity) {
        cz.proks.easyhelpdesk.gae.api.impl.dbo.Filter dbo = instantiateDbo(entity);

        if (dbo != null)
            dbo.toDbo(entity);

        return dbo;
    }

}
